#pragma once

#include <iostream>
#include <string>
#include <functional>

// typedef std::function<int(int, int)> Func_t;

using Func_t = std::function<void (int, const std::string &, const uint16_t &)>;

class Task
{
public:
    Task()=default;

    Task(Func_t func,int sock,const std::string &ip,uint16_t port)
        :_func(func),_sock(sock),_ip(ip),_port(port)
    {}

    void operator ()(const std::string &name)
    {
        std::cout<<name<<" : run..."<<std::endl;
        _func(_sock,_ip,_port);
    }
public:
    Func_t _func;
    int _sock;
    std::string _ip;
    uint16_t _port;
};